
var connection = require("../../app_modules/dbAccess/mongoConfig.js");
var mongoose = require('mongoose');
var db = mongoose.createConnection(connection.getConnectionString("")); //连接test数据库
//var db = mongoose.Connection(connection.getConnectionString(""));

var Schema = mongoose.Schema; //创建模型【骨架模板】
var newsImageSchema = new Schema({
    filename: String,
    createDate:Date,
});

newsImageSchema.methods.add = function (newsImage, callback) {
    this.filename = newsImage.filename;
    this.createDate = newsImage.createDate;
    this.save(callback);
}
var newsImage = db.model('newsImages', newsImageSchema);
module.exports = newsImage;
